package cn.z2huo.usercenter.authentication.app.interceptor;

import jakarta.servlet.http.HttpServletRequest;
import jakarta.servlet.http.HttpServletResponse;
import lombok.RequiredArgsConstructor;
import org.redisson.api.RedissonClient;
import org.springframework.stereotype.Component;
import org.springframework.web.servlet.HandlerInterceptor;

import java.time.Duration;

/**
 * <p>
 *
 * @author z2huo
 */
@Component
@RequiredArgsConstructor
public class TokenBucketLimitLoginInterceptor implements HandlerInterceptor {

    private final RedissonClient redissonClient;

    private static final int LIMIT_COUNT = 5;

    private static final Duration LIMIT_TIME_DURATION = Duration.ofSeconds(60);

    @Override
    public boolean preHandle(HttpServletRequest request, HttpServletResponse response, Object handler) throws Exception {



        return HandlerInterceptor.super.preHandle(request, response, handler);
    }
}
